package com.hulk.hyena.project.system.notice.service;

import java.util.List;

import com.hulk.hyena.common.utils.StringUtils;
import com.hulk.hyena.project.system.notice.mapper.NoticeMapper;
import com.hulk.hyena.framework.service.impl.BaseServiceImpl;
import com.hulk.hyena.project.system.notice.domain.SysNotice;
import org.springframework.stereotype.Service;

/**
 * 公告 服务层实现
 *
 * @author hulk
 */
@Service
public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, SysNotice> implements INoticeService {

    @Override
    public List<SysNotice> selectNoticeList(SysNotice notice) {
        return query().like(StringUtils.isNotEmpty(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle())
                .eq(StringUtils.isNotEmpty(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType())
                .like(StringUtils.isNotEmpty(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy())
                .list();
    }

}
